﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sinacor.UI.Bovespa.Corretagem.Communication.Bovespa.Cliente.Cliente;
using Sinacor.Infra.UI.Common;
namespace Sinacor.UI.Bovespa.Corretagem.Communication.Translator.DataContractToModel
{
    //Task  : 5617 
    // Data : 16/03/2009
    // Autor:Apsilva
    /// <summary>
    /// Translator  Cliente de Data Contract para Model
    /// </summary>
    /// 
    public class Cliente
    {
        public Model.Cliente ToCliente(ClienteResponse request)
        {
            Model.Cliente to = new Model.Cliente();
            to.Apelido = request.Apelido;
            to.Codigo = request.Codigo; 
            return to;
        }

        public ModelCollection<Model.Cliente> ToCliente(List<ClienteResponse> request)
        {
            ModelCollection<Model.Cliente> response = new ModelCollection<Model.Cliente>();
            foreach (ClienteResponse item in request)
            {
                response.Add(ToCliente(item));
            }

            return response;
        }

    }
}
